<%--
  Created by IntelliJ IDEA.
  User: 谢兴鑫
  Date: 2022/5/16
  Time: 上午 08:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>信息表</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/ajaxForm.js"></script>
</head>
<script>
    layui.use(['form', 'laydate', 'layer'], function () {
        var form = layui.form, laydate = layui.laydate, layer = layui.layer;
        laydate.render({
            elem: '#entrytime',
            type: 'date',//指定日期选择器类型 date,time,datetime
            trigger: 'click'
        });

        //自定义验证规则
        form.verify({
            v_sname: function (val, item) {//正则表达式验证规则
                if (/^\d+\d+\d$/.test(val)) {
                    return "用户名不能全为数字！！！"
                }
            },
        });



        //监听表单提交
        form.on('submit(formbtn)', function () {
            $("#formsbt").ajaxSubmit({
                type: "post",
                url: '${pageContext.request.contextPath}/weeklys/addWeeklyNews',
                success: function (data) {//添加成功的回调函数
                    layer.msg("添加成功！", {icon: 6});//使用消息层，显示删除的结果。
                    var index = parent.layer.getFrameIndex(window.name);//获取Frame索引
                    parent.layer.close(index);//关闭当前frame
                    parent.layui.table.reload("tableData");//可以对父窗口进行刷新
                }
            });
        });

    });
</script>
<body>
<form class="layui-form" id="formsbt" enctype="multipart/form-data">

    <div class="layui-form-item">
        <div class="layui-input-inline">
            <input type="hidden" name="worklogId" id="worklogId" placeholder="周报编号" autocomplete="off"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-inline">
            <input type="hidden" name="empId" id="empId" placeholder=员工编号" value="${sessionScope.empID}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">本周情况描述</label>
        <div class="layui-input-inline">
            <textarea style="width: 550px" name="weekCur" id="weekCur"  required lay-verify="required" placeholder="情况描述" class="layui-textarea"></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">问题学生情况反馈</label>
        <div class="layui-input-inline">
            <textarea style="width: 550px" name="studentQuestion" id="studentQuestion"  required lay-verify="required" placeholder="情况描述" class="layui-textarea"></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">意见建议</label>
        <div class="layui-input-inline">
            <textarea style="width: 550px" name="idea" id="idea"  required lay-verify="required" placeholder="意见建议" class="layui-textarea"></textarea
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">下周工作计划</label>
        <div class="layui-input-inline">
            <textarea style="width: 550px" name="weekNext" id="weekNext"  required lay-verify="required" placeholder="工作计划" class="layui-textarea"></textarea
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <button id="formbtn" type="button" lay-submit lay-filter="formbtn" class="layui-btn layui-btn-normal">
            保存
        </button>
        <button id="reset" type="reset" class="layui-btn layui-btn-normal">
            重置
        </button>
    </div>


</form>
<script>

</script>


</body>
</html>

